package com.ftg.learn.day05;

import sun.misc.GC;

/**
 * 创建
 *
 * @author 布衣
 */
public class LearnArray01 {



    public static void main(String[] args) {

        //数组是基本类型吗？不是。引用类型
        int[] arr01 = new int[3];
        arr01[0] = 4;
        arr01[1] = 6;
        arr01[2] = 7;


        //for 遍历
        for(int i = 0;i < arr01.length;i++){
            System.out.println(arr01[i]);
        }

        System.out.println(arr01[2]);


        //还有哪些创建方式  局部变量，不会有人给初始值
        int[] arr02;   //arr02 = null;

        //arr03 长度为3 0 1 2
        int[] arr03 = {4,6,1};

        arr03[0] = 7;

        //arr04
        int[] arr04 = new int[]{2,3,4};

    }

}
